<script type="text/javascript">


</script>
<head>
    <script src="js/clientes.js" type="text/javascript"></script>
    <script src="js/almacen.js" type="text/javascript"></script>
    <script src="js/cobros.js" type="text/javascript"></script>
    <script src="js/movimientos.js" type="text/javascript"></script>
    <script src="js/items.js" type="text/javascript"></script>
</head>
<body onload="selectPantallaAlmacen();">
    <div style="height: 35px;"></div>
    <table id="clientes" border="0" style="width: 100%;">
        <tbody>
            <tr><td colspan="8"><h1>Almacen y Bebidas</h1></td><td></td></tr>
            <tr>
                <td>Producto</td>
                <td>Seleccionado</td>
            </tr>
            <tr style="width: 100%;">
                <td style="width: 50%;">
                    <SELECT  style="width: 100%;" name="lstItems" id="lstItems" class="generalList" size="5" ondblclick="addItem();">
                        <?php
                        require_once './src/MyDBi.php';
                        $db = new MysqliDb();
                        $results = $db->rawQuery("Select * from items where Stock > 0");
                        foreach ($results as $row) {
                            echo "<option value='" . $row["IdItem"] . "-" . $row["Cuenta"] . "'>" . $row["Nombre"] . " - " . $row["Precio"] . "</OPTION>";
                        }
                        ?>
                    </SELECT>
                </td>
                <td>
                    <SELECT style="width: 100%;" name="lstSeleccionados" id="lstSeleccionados" class="generalList" size="5" ondblclick="removeItem();">

                    </SELECT> 
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <table id="almacen" border="0" style="width: 100%;">
                        <tbody>

                            <tr>
                                <td>Nombre</td>
                                <td><input type="text" id="txtNombre" name="txtNombre" value=""  onkeyup="getClientes('Apellido', 4, 'listado', 'almacen');" class="generalInput search"/></td>
                                <td>Apellido</td>
                                <td><input type="text" id="txtApellido" name="txtApellido" value=""  onkeyup="getClientes('Apellido', 4, 'listado', 'almacen');" class="generalInput search"/></td>
                            </tr>
                            <tr >
                                <td colspan="12">
                                    <div  style="overflow-y:scroll;height: 200px;">
                                        <table id="results" class="resultsHeader" style="width: 100%;" cellspacing="0" cellpadding="0" border="0">
                                            <thead >
                                                <tr >
                                                    <th style="width: 10px;" onclick="getClientes('IdCliente')" >Id</th>
                                                    <th onclick="getGastos('Fecha')" >Nombre</th>
                                                    <th>Apellido</th>
                                                    <th>Mail</th>
                                                    <th>Nacionalidad</th>
                                                    <th>Comentarios</th>
                                                    <th>Tipo Doc.</th>
                                                    <th>Nro. Doc.</th>
                                                    <th>Marcado</th>

                                                </tr>
                                            </thead>
                                            <tbody id="listado" style="">

                                            </tbody>   

                                        </table>
                                    </div>
                                </td>
                            </tr>

                        </tbody>
                    </table>
                </td>
            </tr>
            <tr>
                <td></td>
                <td colspan="1" style="font-size: 1.3em;font-weight: bold;color: #2d97af;text-align: right;">$<label id="txtPrecioAlmacen"></label>
                    <input type="button" value="Cobrar" name="cobrar" onclick="cobroAlmacen()" class="btnSave"/></td>
            </tr>
        </tbody>
    </table>
    <input type="hidden" id="hRol" value="<?php echo $_SESSION['remises_rol'] ?>"/>
    <div id="resultadosServer" class="resultadosServer" ></div>
    <div id="almacenCobros"><?php include './cobros.php' ?></div>
</body>